package com.ysm.freestyle.test.jetpack

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import com.ysm.freestyle.R

class NavigationActivity : AppCompatActivity() {

    lateinit var navigator : NavController
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_navigation)
//        navigator = Navigation.findNavController(this, R.id.my_nav_host_fragment)

        val navHostFragment =
            supportFragmentManager.findFragmentById(R.id.my_nav_host_fragment) as NavHostFragment?
        val navigator = navHostFragment!!.navController

        navigator.navigateUp()
        navigator.navigate(R.id.action_userFragment_to_mineFragment)
    }







}